
import {simpleServer} from '@/tools/servers'

/**
 * 城市
 */
export class CityService {
    // 分页查询列表
    static findCitys (pageDTO) {
        var httpMethod = 'POST';
        var body = simpleServer.getArgs(this.findCitys,arguments,'POST');
        return simpleServer.connection(httpMethod, '/simple/businessRegistration/City/findCitys', body);
    }


    //根据城市Id查询城市
    static findCity (cityId) {
        var httpMethod = 'GET';
        var body = simpleServer.getArgs(this.findCity ,arguments,'GET');
        return simpleServer.connection(httpMethod, '/simple/businessRegistration/City/findCity',body);
    }

    //为了编辑,根据城市Id查询城市
    static findCityForEdit(cityId) {
        var httpMethod = 'GET';
        var body = simpleServer.getArgs(this.findCityForEdit ,arguments,'GET');
        return simpleServer.connection(httpMethod, '/simple/businessRegistration/City/findCityForEdit',body);
    }

    //为了查看,根据城市Id查询城市，所有外键字段的名称都已加载
    static findCityForView(cityId) {
        var httpMethod = 'GET';
        var body = simpleServer.getArgs(this.findCityForView ,arguments,'GET');
        return simpleServer.connection(httpMethod, '/simple/businessRegistration/City/findCityForView',body);
    }

    //创建新的城市
    static createCity() {
        var httpMethod = 'GET';
        var body = simpleServer.getArgs(this.createCity,arguments,'GET');
        return simpleServer.connection(httpMethod, '/simple/businessRegistration/City/createCity',body);
    }

    //保存城市
    static saveCity(city) {
        var httpMethod = 'POST';
        var body = simpleServer.getArgs(this.saveCity,arguments,'POST');
        return simpleServer.connection(httpMethod, '/simple/businessRegistration/City/saveCity', body);
    }

    //编辑城市
    static updateCity (city) {
        var httpMethod = 'POST';
        var body = simpleServer.getArgs(this.updateCity,arguments,'POST');
        return simpleServer.connection(httpMethod, '/simple/businessRegistration/City/updateCity', body);
    }

    //根据城市Id删除城市
    static deleteCity (cityId) {
        var httpMethod = 'GET';
        var body = simpleServer.getArgs(this.deleteCity,arguments,'GET');
        return simpleServer.connection(httpMethod, '/simple/businessRegistration/City/deleteCity',body);
    }

    //为了查看,根据城市Id查询城市，只加载ID 和 名称
    static findCitysWithIdNameById(cityId) {
        var httpMethod = 'GET';
        var body = simpleServer.getArgs(this.findCitysWithIdNameById ,arguments,'GET');
        return simpleServer.connection(httpMethod, '/simple/businessRegistration/City/findCitysWithIdNameById',body);
    }

    //为了查看,根据城市 名称 查询城市，只加载ID 和 名称
    static findCitysWithIdNameByName(cityName) {
        var httpMethod = 'GET';
        var body = simpleServer.getArgs(this.findCitysWithIdNameByName ,arguments,'GET');
        return simpleServer.connection(httpMethod, '/simple/businessRegistration/City/findCitysWithIdNameByName',body);
    }


}
